package com.fhz.kotlinstest.paging

import androidx.recyclerview.widget.DiffUtil

class UserCallback: DiffUtil.ItemCallback<Student>() {
    //判断item对象是否相同
    override fun areItemsTheSame(oldItem: Student, newItem: Student): Boolean {
        return oldItem.title == newItem.title
    }
    //判断item内容是否相同
    override fun areContentsTheSame(oldItem: Student, newItem: Student): Boolean {
        return oldItem.name == newItem.name
    }
}